using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace BoOnce.Core
{
    public abstract class BackgroundTask
    {
        protected Boolean _Done = false;


        /// <summary>
        /// Constructor
        /// </summary>
        public BackgroundTask()
        {
            _Done = false;
        }

        /// <summary>
        /// BT is done ?
        /// Useful for the BTManager (BackgrounndTaskComponent)
        /// </summary>
        public Boolean IsDone()
        {
            return this._Done;
        }

        /// <summary>
        /// Call first to initialized the BT
        /// </summary>
        //public virtual void Initialize() { }
        
        /// <summary>
        /// Kill the BT
        /// </summary>
        public void Kill()
        {
            BeforeKill();
            _Done = true;
        }

        /// <summary>
        /// Stop properly the BT and release resources
        /// </summary>
        public virtual void BeforeKill() { }

        /// <summary>
        /// Update the BT
        /// </summary>
        /// <param name="time">GameTime information</param>
        public abstract void Update(GameTime time);
    }
}
